//
//  BaseViewController.m
//  project-demo-oc
//
//  Created by 赵隆杰 on 2021/5/31.
//

#import "BaseViewController.h"

@interface BaseViewController ()<BaseNavBarViewDelegate>

@end

@implementation BaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    
    BaseNavBarView *baseNav = [[BaseNavBarView alloc] init];
    baseNav.delegate = self;
    [self.view addSubview:baseNav];
    [baseNav mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.top.equalTo(self.view);
        make.height.mas_equalTo(SL_VC_HEADER_HEIGHT);
    }];
    
    baseNav.backBtn.hidden = !(self.navigationController.viewControllers.count > 1);
    
    self.baseNavView = baseNav;
    self.baseNavView.centerLabel.text = self.navigationController.tabBarItem.title;

}

- (void)setTitle:(NSString *)title
{
    self.baseNavView.centerLabel.text = title;
}

- (void)backBtnBlock
{
    [self.navigationController popViewControllerAnimated:YES];
    
}


@end
